package com.wangshouyu.mp.base.request;

import java.io.InputStream;
import java.util.Collection;
import java.util.Map;

/**
 * @author 王守钰
 * @date 2020年12月04日 19:31
 * @description 微信公众号响应
 */
public class MpResponse<T> {

    /**
     * 响应数据
     */
    private T data;

    /**
     * 状态码
     */
    private int status;

    /**
     * 返回头信息
     */
    private Map<String, Collection<String>> headers;

    /**
     * 响应消息
     */
    private String responseMessage;

    /**
     * 响应体
     */
    private ResponseBody body;


    public T getData() {
        return data;
    }

    public void setData(T data) {
        this.data = data;
    }

    public int getStatus() {
        return status;
    }

    public void setStatus(int status) {
        this.status = status;
    }

    public Map<String, Collection<String>> getHeaders() {
        return headers;
    }

    public void setHeaders(Map<String, Collection<String>> headers) {
        this.headers = headers;
    }

    public String getResponseMessage() {
        return responseMessage;
    }

    public void setResponseMessage(String responseMessage) {
        this.responseMessage = responseMessage;
    }

    public ResponseBody getBody() {
        return body;
    }

    public void setBody(ResponseBody body) {
        this.body = body;
    }

    public void body(InputStream inputStream, Integer length){
        this.body = InputStreamBody.orNull(inputStream, length);
    }
}
